package com.example.tuter.fragment.entity;

import com.example.tuter.entity.SemesterPair;

import java.util.ArrayList;
import java.util.stream.Collectors;

public class TimeSemester {
    //存储时间标签和值
    private String[] labels = {"未初始化"};
    private String[] ids = {"未初始化"};

    public TimeSemester(ArrayList<SemesterPair> semesterPairs){
        labels = semesterPairs.stream().map(s -> s.label).collect(Collectors.toList()).toArray(new String[semesterPairs.size()]);
        ids = semesterPairs.stream().map(s -> s.id).collect(Collectors.toList()).toArray(new String[semesterPairs.size()]);
    }
    public TimeSemester(){

    }

    public String[] getLabels() {
        return labels;
    }

    public void setLabels(String[] labels) {
        this.labels = labels;
    }

    public String[] getIds() {
        return ids;
    }

    public void setIds(String[] ids) {
        this.ids = ids;
    }

}
